#include <iostream>
#include <string>
using namespace std;

template<typename T1, typename T2>
class Person;

template<typename T1, typename T2>
void showPerson(Person<T1, T2> p)
{
	cout<<p.name<<endl;
	cout<<p.age<<endl;
}

template<typename T1, typename T2>
class Person
{
	// 声明模板参数声明而不是与函数模板混淆
	friend void showPerson<>(Person p);
public:
	Person(T1 name, T2 age)
	{
		this->name = name;
		this->age = age;
	}
	~Person(){};
private:
	T1 name;
	T2 age;
};
int main(int argc, char const *argv[])
{
	Person<string, int> p("tom", 10);
	showPerson(p);
	return 0;
}